#include "darray.h"
#include "def.h"

int darray_test(void)
{
    printf("** darray test:\n");
    darray_t *da = darray_create(0, NULL);
    assert(da);

    int i;
    for(i = 0; i < 2048; ++i){
        if(darray_insert(da, 0, (void *)i) < 0){
            printf("darray_insert failed");
            return -1;
        }
    }
    printf("darray_insert success\n");

    int data;
    for(i = 0; i < 2048; ++i){
        data = (int)darray_get(da, i);
        printf("data = %d\n", data);
    }

    darray_destroy(&da, NULL);
    printf("** darray test success\n");
	return 0;
}
